
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

import VueRouter from 'vue-router'
Vue.use(VueRouter)
import router from './routes'
import App from './components/App'
Vue.component('app',App)
// Vue.component('example-component', require('./components/ExampleComponent.vue'));

import VeeValidate , { Validator } from 'vee-validate';
import zh_CN from 'vee-validate/dist/locale/zh_CN'

Validator.localize('zh_CN',zh_CN);

Vue.use(VeeValidate, {
    locale:'zh_CN',


})


import store from './store/index'

import JWTToken from './helpers/jwt'

axios.interceptors.request.use(function(config){
    if(JWTToken.getToken()){
        config.headers['Authorization']='Bearer' +' '+ JWTToken.getToken();
    }
    return config;
},function (error){
    return Promise.reject(error)
})

new Vue({
    el: '#app',
    router,
    store
});
